// pages/time/time.js
Page({


    data: {
        num:3,
        str:"发送验证码",
        disabled:false
    },
    handleTap(){
        var that=this
        var num=this.data.num;
        var disabled=false
        var times=setInterval(function(){
            if(num<0){
                num=3;
                disabled=false;
                that.setData({
                    num,disabled,str:"发送验证码"
                })
                clearInterval(times);
            }else{
                disabled=true;
                that.setData({
                    num,disabled,str:num+"s"
                })
                num--;
            }
        },1000)
    }
    
})